package com.mingke.chat.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.channels.CompletionHandler;

/**
 * @author mingke
 * @function 写入数据的回调
 * @date 2021/12/14
 */
public class WriteHandler implements CompletionHandler<Integer, Void> {
    //日志框架
    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @Override
    public void completed(Integer flag, Void attachment) {
        log.info("消息发送完毕，标志位为: "+flag);
    }

    @Override
    public void failed(Throwable exc, Void attachment) {
        exc.printStackTrace();
    }
}
